class sPanel;

const int ST_CLICK = 0;

typedef std::list<sPanel*> sPanelList;

class sPanel : public sObject

{
protected:
	int nav;
	int md;
	sEvent onclick;
	sEvent onmousemove;
	sEvent onmousedown;
	sEvent onmouseup;
	sEvent onmouseenter;
	sEvent onmouseleave;

	int x,y,width,height;
	float r,g,b,a;
	float nr,ng,nb,na;

	sPanelList *childs;
	sPanel *parent;

	int visible;

	int isaction;
	int isselectably;

	int sel;

	int clicked;
public:
	sPanel();
	virtual ~sPanel();

	void Show();
	void Hide();

	void SetParent(sPanel *parent);
	void SetBounds(int x, int y, int width, int height);
	void SetColor(float r,float g,float b);
	void SetColor(int r,int g,int b);
	void SetAlpha(float alpha);
	void SetAlpha(int alpha);

	void SetPosition(int x,int y);
	void SetSize(int width, int height);

	void Draw();

	void OnClick(sEvent ev);
	void OnMouseDown(sEvent ev);
	void OnMouseUp(sEvent ev);
	void OnMouseMove(sEvent ev);
	void OnMouseEnter(sEvent ev);
	void OnMouseLeave(sEvent ev);

	virtual void Process();

	int GetX();
	int GetY();
	int GetWidth();
	int GetHeight();

	int GetStatus(int s);
};